﻿/*****************************************************************//**
 * @file    FITKAcousticsVTKGraphObjectSEAJunctions.h
 * @brief   Graph object base for SEA junctions data.
 *  
 * @author  ChengHaotian (yeguangbaozi@foxmail.com)
 * @date    2024-11-19
 *********************************************************************/

#ifndef __FITKACOUSTICSVTKGRAPHOBJECTSEAJUNCTIONS_H__
#define __FITKACOUSTICSVTKGRAPHOBJECTSEAJUNCTIONS_H__

#include "FITKAcousticsVTKGraphObjectMergedData.h"
#include "FITKAcousticsVTKGraphAdaptorAPI.h"
#include "FITK_Component/FITKAcousticsModel/FITKSEAAbstractJunction.h"

// Forward declaration
class vtkCompositeDataGeometryFilter;

class FITKAcousticsVTKGraphActor;

namespace Acoustics
{
    class FITKAcousticsDiscModel;
    class FITKAbstractJunction;
    class FITKJunctionManager;
}

namespace Exchange
{
    class FITKAcousticsVTKGraphObjectSEASelectMergedData;
}

namespace Exchange
{
    /**
     * @brief   Graph object base for 'SEA junctions'.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-11-19
     */
    class FITKACOUSTICSGRAPHADAPTORAPI FITKAcousticsVTKGraphObjectSEAJunctions : public FITKAcousticsVTKGraphObjectMergedData
    {
        // Regist
        FITKGraphObjectRegist(FITKAcousticsVTKGraphObjectSEAJunctions, FITKAcousticsVTKGraphObjectMergedData);
        FITKCLASS(Exchange, FITKAcousticsVTKGraphObjectSEAJunctions);

    public:
        /**
         * @brief   Constructor.
         * @param   seaModel: The SEA model data
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        FITKAcousticsVTKGraphObjectSEAJunctions(Acoustics::FITKAcousticsDiscModel* seaModel);

        /**
         * @brief   Destructor.[virtual]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        virtual ~FITKAcousticsVTKGraphObjectSEAJunctions() = default;

        /**
         * @brief   Update all graph actors.[virtual][override]
         * @param   forceUpdate: Force update[default]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        virtual void update(bool forceUpdate = false) override;

        /**
         * @brief   Update the visibility with data object's visibility.[virtual][override]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-20
         */
        virtual void updateVisibility() override;

        /**
         * @brief   Update all graph actors by the given data id.[virtual][override]
         * @param   dataId: The data id need to be update
         * @param   forceUpdate: Force update[default]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        virtual void updateById(int dataId, bool forceUpdate = false) override;

        /**
         * @brief   Get the visibility from the data object.[virtual][override]
         * @return  The visibility
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        virtual bool getDataVisibility() override;

    protected:
        /**
         * @brief   Get the visibility of SEA junction with runtime settings.
         * @return  The visibility
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        bool getGlobalSEAJunctionVisibility();

        /**
         * @brief   Update the glyph size.[pure virtual]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-19
         */
        virtual void updateGlyphSizeByRatio() = 0;

    protected:
        /**
         * @brief   The SEA junction manager.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-20
         */
        Acoustics::FITKJunctionManager* m_SEAJunctionMgr{ nullptr };

        /**
         * @brief   The SEA junctions type enum value.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-11-20
         */
        Acoustics::FITKAbstractJunction::JunctionType m_SEAJunctionTypeEnum = Acoustics::FITKAbstractJunction::JunctionType::NoneJunction;

    };
}   // namespace Exchange

#endif // __FITKACOUSTICSVTKGRAPHOBJECTSEAJUNCTIONS_H__
